﻿using System;
using System.Data;
using System.Collections;
using CE.Database;

/// <summary>
/// Summary description for PASelectItemPromoDB
/// </summary>
/// 
namespace CE.PersonalAccident
{
    public class PASelectItemPromoDB
    {
        public PASelectItemPromoDB()
        {
            //
            // TODO: Add constructor logic here
            //
        }

        public Int64 Insert(PASelectItemPromo paselectitempromo)
        {
            MyDatabase _db = new MyDatabase();
            Int64 _result = -1;
            string _spName = "sprocPAInsuranceSelectItemPromoInsertUpdateSingleItem";

            SortedList _sPara = new SortedList();

            #region Parameter
            _sPara.Add("@PASelectItemId", paselectitempromo.PASelectItemId);
            _sPara.Add("@PromotionID", paselectitempromo.PromotionID);
            _sPara.Add("@AnnualPremium", paselectitempromo.AnnualPremium);
            _sPara.Add("@DiscountedPremium", paselectitempromo.DiscountedPremium);
            _sPara.Add("@RefCEUserId", paselectitempromo.RefCEUserId);
            #endregion

            _result = _db.ExecuteSP(_spName, _sPara);

            return _result;
        }

        public DataTable GetSelectItemPromo(string OrderNo)
        {
            MyDatabase _db = new MyDatabase();
            DataTable _dtResult = new DataTable("promo");
            string _spName = "sprocPAInsuranceSelectItemPromoGetSingleItem";
            SortedList _sPara = new SortedList();

            #region Parameter
            _sPara.Add("@OrderNo", OrderNo);
            #endregion

            _dtResult = _db.GetDataTableBySP(_spName, _sPara);
            return _dtResult;
        }


    }
}